package sweetguy.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "员工修改DTO")
public class EmpUpdateDTO implements Serializable {
    /** 主键 */
    @NotNull(message = "主键ID不能为空")
    @Schema(description = "主键")
    private Long id;

    @Pattern(regexp = "^[a-zA-Z0-9_-]{4,16}$",
            message = "登录账号必须由4-16位的数字，字母，下划线或横线组成")
    @Schema(description = "登录账号")
    private String username;

    @Pattern(regexp = "^[a-zA-Z0-9_-]{4,16}$",
            message = "登录密码必须由4-16位的数字，字母，下划线或横线组成")
    @Schema(description = "登录密码")
    private String password;

    @Pattern(regexp = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$",
            message = "手机号码格式不正确")
    @Schema(description = "手机号码")
    private String phone;

    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{2,4}$",
            message = "姓名须由2到4个中文组成")
    @Schema(description = "真实姓名")
    private String realname;

    @Schema(description = "身份证号")
    @Pattern(regexp = "^\\d{17}[X|0-9]$", message = "身份证号格式不正确")
    private String idcard;

    @Schema(description = "部门外键")
    private Long fkDeptId;

    @Schema(description = "入职日期")
    private LocalDateTime hiredate;

    @Schema(description = "微信号码")
    private String wechat;

    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$",
            message = "电子邮箱格式不正确")
    @Schema(description = "电子邮箱")
    private String email;
}
